{include file='common/head'}
<div style="overflow-x: hidden;width: 96%;margin: auto;padding-top: 1rem;">
    <div class="layui-form" action="" method="post">
        <div class="layui-form-item">

            <div class="layui-form-item">
                <label class="layui-form-label">中文名称</label>
                <div class="layui-col-xs6">
                    <input type="text" name="cn_name"  lay-verify="title" readonly  autocomplete="off" value="{$info.cn_name}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-col-xs6">
                    {if($info.ganer == 1)}
                    <input type="checkbox"  lay-skin="primary" title="男"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="女"  disabled="">
                    {/if}

                    {if($info.ganer == 2)}
                    <input type="checkbox"  lay-skin="primary" title="男"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="女"  disabled="" checked="">
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">出生年月</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.birth_cn}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">所在地区</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.addres}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">您目前是</label>
                <div class="layui-col-xs6">
                    {if($info.occupation == 1)}
                    <input type="checkbox"  lay-skin="primary" title="在读本科生"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="在读硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业本科"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" >
                    {/if}

                    {if($info.occupation == 2)}
                    <input type="checkbox"  lay-skin="primary" title="在读本科生"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="在读硕士"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="已毕业本科"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" >
                    {/if}

                    {if($info.occupation == 3)}
                    <input type="checkbox"  lay-skin="primary" title="在读本科生"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="在读硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业本科"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="已毕业硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" >
                    {/if}

                    {if($info.occupation == 4)}
                    <input type="checkbox"  lay-skin="primary" title="在读本科生"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="在读硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业本科"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业硕士"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" >
                    {/if}
                    {if($info.occupation == 5)}
                    <input type="checkbox"  lay-skin="primary" title="在读本科生"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="在读硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业本科"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="已毕业硕士"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" checked="">
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">每周授课时间</label>
                <div class="layui-col-xs6">
                    {if($info.time == 1)}
                    <input type="checkbox"  lay-skin="primary" title="6-8小时"  disabled=""  checked="">
                    <input type="checkbox"  lay-skin="primary" title="8-10小时"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="20小时以上"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="">
                    {/if}
                    {if($info.time == 2)}
                    <input type="checkbox"  lay-skin="primary" title="6-8小时"  disabled=""  >
                    <input type="checkbox"  lay-skin="primary" title="8-10小时"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="20小时以上"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="">
                    {/if}
                    {if($info.time == 3)}
                    <input type="checkbox"  lay-skin="primary" title="6-8小时"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="8-10小时"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="20小时以上"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="">
                    {/if}
                    {if($info.time == 4)}
                    <input type="checkbox"  lay-skin="primary" title="6-8小时"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="8-10小时"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="20小时以上"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title=" 其他"  disabled="" checked="">
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">带宽网络</label>
                <div class="layui-col-xs6">
                    {if($info.is_teching == 1)}
                    <input type="checkbox"  lay-skin="primary" title="是"  disabled=""  checked="">
                    <input type="checkbox"  lay-skin="primary" title="否"  disabled="" >
                    {/if}
                    {if($info.is_teching == 0)}
                    <input type="checkbox"  lay-skin="primary" title="是"  disabled=""  >
                    <input type="checkbox"  lay-skin="primary" title="否"  disabled="" checked="">
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">汉语作为外语教学经验</label>
                <div class="layui-col-xs6">
                    {if($info.experience == 1)}
                    <input type="checkbox"  lay-skin="primary" title="一年"  disabled=""  checked="">
                    <input type="checkbox"  lay-skin="primary" title="二年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="三年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="其他"  disabled="">
                    {/if}
                    {if($info.experience == 2)}
                    <input type="checkbox"  lay-skin="primary" title="一年"  disabled=""  >
                    <input type="checkbox"  lay-skin="primary" title="二年"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="三年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="其他"  disabled="">
                    {/if}
                    {if($info.experience == 3)}
                    <input type="checkbox"  lay-skin="primary" title="一年"  disabled=""  >
                    <input type="checkbox"  lay-skin="primary" title="二年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="三年"  disabled="" checked="">
                    <input type="checkbox"  lay-skin="primary" title="其他"  disabled="">
                    {/if}
                    {if($info.experience == 4)}
                    <input type="checkbox"  lay-skin="primary" title="一年"  disabled=""  >
                    <input type="checkbox"  lay-skin="primary" title="二年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="三年"  disabled="" >
                    <input type="checkbox"  lay-skin="primary" title="其他"  disabled="" checked="">
                    {/if}
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">毕业院校</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.graduated_from}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">所学专业</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.major}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">所学专业</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.wechat}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">手机号</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.phone}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-col-xs6">
                    <input type="text"  lay-verify="title" readonly  autocomplete="off" value="{$info.email}" class="layui-input">
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">个人简历</label>
                <div class="layui-col-xs6">
                    <a href="{$info.resume}" target="_blank">点击查看</a>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">个人近照</label>
                <div class="layui-col-xs6">
                    <img src="{$info.avatar}" alt="">
                </div>
            </div>

            <input type="hidden" id="el_log" value="{$el_log}" lay-verify="title" autocomplete="off" class="layui-input">
            {if($info.is_adopt == 0)}
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit="" lay-filter="demo21" id="pass">通过</button>
                </div>
            </div>
            {/if}
        </div>
    </div>
    {include file='common/footer'}
    <script>





        layui.use('layedit', function(){
            var layedit = layui.layedit;
            layedit.set({
                uploadImage: {
                    url: '{:url("Upload/file_content")}' //接口url
                    ,type: 'post' //默认post
                }
            });
            //注意：layedit.set 一定要放在 build 前面，否则配置全局接口将无效。

        });



    </script>


    <script>
        layui.use(['form', 'layedit', 'laydate'], function(){
            var form = layui.form
                ,layer = layui.layer
                ,layedit = layui.layedit
                ,laydate = layui.laydate;

            //日期
            laydate.render({
                elem: '#date'
            });
            laydate.render({
                elem: '#date1'
            });

            //创建一个编辑器
            var editIndex = layedit.build('demo');

            //自定义验证规则
            form.verify({
                pass: [/(.+){6,12}$/, '密码必须6到12位']
                ,content: function(value){
                    layedit.sync(editIndex);
                }
            });

            //监听指定开关
            form.on('switch(switchTest)', function(data){
                layer.msg('开关checked：'+ (this.checked ? 'true' : 'false'), {
                    offset: '6px'
                });
                layer.tips('温馨提示：请注意开关状态的文字可以随意定义，而不仅仅是ON|OFF', data.othis)
            });

            $('#pass').click(function () {
                var el_log = $('#el_log').val();
                $.ajax({
                    url: '{:url("Teacher/changeAdopt")}',
                    type: 'post',
                    dataType: 'json',
                    data: {'el_log':el_log},
                    success: function (obj) {
                        if(obj.code==200){
                            parent.layer.msg(obj.msg, {icon: 6,time: 1000});
                            //当你在iframe页面关闭自身时
                            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                            parent.layer.close(index); //再执行关闭
                        }
                        if(obj.code==400){
                            layer.msg(obj.msg, {icon: 5,time: 1000});
                        }
                    },
                    error:function(data){
                        console.log(data);
                    }
                });
            });


            //监听提交
            form.on('submit(demo1)', function(data){

            });


        });
    </script>

    </body>
    </html>